package com.netbetter.langzheng.plugin.fileManager.context;

import java.util.List;

import com.netbetter.langzheng.plugin.fileManager.model.FileModel;

/**
 * @author 嘉陵江里捉鱼 email:tang7259@163.com
 *@version 1.0
 *@time 2008-9-13 下午01:56:08
 */
public class TableEventContext {

    private static List<FileModel> subList;

    public static List<FileModel> getSubList() {
        return subList;
    }

    public static void setSubList(List<FileModel> subList) {
        TableEventContext.subList = subList;
    }

    /**
     * 判断是否存在同名的节点
     * 
     * @param name
     * @return
     */
    public static boolean isExistByName(String name) {
        if (subList != null) {
            for (FileModel item : subList) {
                if (item.getName().toLowerCase().equals(name.toLowerCase())) {
                    return true;
                }
            }
        }
        return false;
    }
}
